package com.dpwx.framework.network;

import java.net.URL;

import com.dpwx.framework.task.ITask;

import android.os.AsyncTask;

public abstract class BaseNetworkTask extends AsyncTask<Void, Integer, Void> 
implements ITask{
	
	protected URL mUrl;
	protected IRequest mReq;
	protected IResponse mResp;
	protected INetworkCallback mCallback;
	
	public BaseNetworkTask(URL url, IRequest req, INetworkCallback callback) {
		this.mUrl = url;
		this.mReq = req;
		this.mCallback = callback;
	}
	
	@Override
	public abstract void doTask();
	
	public abstract void onPostExecute();
	

	@Override
	protected abstract Void doInBackground(Void... params);
	
	@Override
	protected void onPostExecute(Void result) {
		onPostExecute();
	}

}
